package com.wordsay.comparator;

import java.util.Comparator;

import com.wordsay.entity.Talk;

public class TalkWordCountComparator implements Comparator {

	@Override
	public int compare(Object arg0, Object arg1) {
		
		Talk talk_1 = (Talk)arg0;
		Talk talk_2 = (Talk)arg1;
		
		if(talk_1.getIwords().size() > talk_2.getIwords().size()){
			return -1;
		}else if(talk_1.getIwords().size() < talk_2.getIwords().size()){
			return 1;
		}
		
		return 0;
	}

}
